#define _WIN32_WINNT 0x501
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include "ntdll.h"
#include <winternl.h>
#include "Struct.h"
extern "C"
{
__declspec(dllimport) NTSTATUS __stdcall NtReadRequestData(
  IN HANDLE               PortHandle,
  IN PPORT_MESSAGE         Request,
  IN ULONG                DataIndex,
  OUT PVOID               Buffer,
  IN ULONG                Length,
  OUT PULONG              ResultLength OPTIONAL );

__declspec(dllimport) NTSTATUS __stdcall NtWriteRequestData(
  IN HANDLE               PortHandle,
  IN PPORT_MESSAGE        Request,
  IN ULONG                DataIndex,
  IN PVOID                Buffer,
  IN ULONG                Length,
  OUT PULONG              ResultLength OPTIONAL );

__declspec(dllimport) NTSTATUS __stdcall NtSystemDebugControl(
  IN SYSDBG_COMMAND       Command,
  IN PVOID                InputBuffer OPTIONAL,
  IN ULONG                InputBufferLength,
  OUT PVOID               OutputBuffer OPTIONAL,
  IN ULONG                OutputBufferLength,
  OUT PULONG              ReturnLength OPTIONAL );

	__declspec(dllimport) NTSTATUS __stdcall LdrFindEntryForAddress(__in const void* addr,PLDR_MODULE* mod);
	__declspec(dllimport) NTSTATUS __stdcall NtFlushInstructionCache(__in HANDLE Process,__in PVOID BaseAddress,__in ULONG NumberOfBytesToFlush);
}
DWORD NTAPI SinSrvClientConnectServer(void);
PVOID MakeCodeCaveInDll(__in PUNICODE_STRING DllName,__in size_t bSize);
NTSTATUS ReadVirtualMemory(SYSDBG_VIRTUAL Data);
NTSTATUS WriteVirtualMemory(SYSDBG_VIRTUAL Data);
typedef ULONG(NTAPI*SinSrvClientApiWithParameter)(void*);
typedef ULONG(NTAPI*SinSrvClientApi)(void);

#include "lpc.h"
#include "DebugSysControl.h"
